/*
 * Copyright (c) 2015 YCY Group Holding Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *
 * $Id: MessageUitl.java  2015-3-19 上午11:01:05 jackLiang $
 */
package com.jkwzms.common.utils;

import java.util.Map;

import com.google.common.collect.Maps;

/**
 * @author JackLiang
 * @date 2015-3-19
 * @version 1.0.0
 */
public class EasyUiMsg {

    /**
     * @param status
     * @param msg
     * @param obj
     * @param attributes
     * @return
     */
    public static Map<String, Object> ajaxMsg(Boolean status, String msg, Object obj, Map<String, Object> attributes) {
        Map<String, Object> map = Maps.newHashMap();
        map.put("success", status);
        map.put("msg", msg);
        map.put("obj", obj);
        map.put("attributes", attributes);
        return map;
    }

    public static Map<String, Object> ajaxMsg(Boolean status, String msg) {
        Map<String, Object> map = Maps.newHashMap();
        map.put("success", status);
        map.put("msg", msg);
        return map;
    }

    /**
     * 成功
     * 
     * @return
     */
    public static Map<String, Object> successMsg(boolean status) {
        Map<String, Object> map = Maps.newHashMap();
        map.put("success", status);
        map.put("msg", status == true ? "操作成功！" : "操作失败！");
        return map;
    }

}
